<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>移动子窗口</title>
<script>
  var child = open("", "", "width=200,height=100,top=300");
  child.document.write("子窗口");
  var w = window.screen.width;
  function moveWindow() {
    for (var i = 0; i < w; i+=0.0003) {
      child.moveBy(i * 20, Math.sin(i) * 30);
    }
  }
</script>
</head>
<body onload="moveWindow()">
  以正弦函数曲线移动子窗口
</body>
</html>